<template>
  <el-container>
    <Menu/>
    <el-container>
      <Header/>
      <HeaderTag/>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import Menu from '@/components/Menu'
import Header from '@/components/Header'
import HeaderTag from '@/components/HeaderTag'
export default {
  name: 'Home',
  components: {
    Menu,
    Header,
    HeaderTag
  },
  mounted() 
    {
        if(this.$session.get("user-pwd-key") !== undefined)
        {
            if(this.$session.get("user-pwd-key")[0] !== '' && this.$session.get("user-pwd-key")[1] !== '')
            {
                this.username = this.$session.get("user-pwd-key")[0]
                this.password = this.$session.get("user-pwd-key")[1]
                this.checked = this.$session.get("user-pwd-key")[2]
            }
        }
        else
        {
            if(this.$route.path !== '/login')
            {
              this.$router.replace('/login')
              alert('想什么呢?老老实实登录!')
            }
            
        }
    },
    created() 
    {
        if(this.$session.get("user-pwd-key") !== undefined)
        {
            if(this.$session.get("user-pwd-key")[0] !== '' && this.$session.get("user-pwd-key")[1] !== '')
            {
              console.log('ψ(｀∇´)ψ 没有人可以救你的     (ó﹏ò｡)呜呜呜~');
              console.log('ヾ(≧O≦)〃嗷~（☍﹏⁰）救命~');
              console.log('(*￣ω￣) 嗯~ 这味道，极品!!!');
              console.log('(￣～￣) 嚼！');
              console.log('Ψ(￣∀￣)Ψ 美味');
              console.log('《 ﾟДﾟ》 不是，你居然隔着屏幕偷窥我?');
              
            }   
            else
            {
                this.$router.replace('/login')
                alert('想什么呢?老老实实登录!')
            }
        }
    },
}
</script>

<style lang="less" scoped>
  .el-container
  {
    height: 100vh;
    .el-container
    {
      display: flex;
      flex-direction: column;
      .el-main
      {
        padding: 5px 10px;
      }
    }
  }
</style>